package com.brother.goallife.type;

import com.brother.goallife.exception.GoallifeException;

public enum AccountStatusType  {
	
	ACTIVE("ACTIV"),
	LOCKED("LOCKE");

	
	private String code;
	
	private AccountStatusType(String code) {
		this.code = code;
	}
	
	public String getCode() {
		return code;
	}
	
	public AccountStatusType getTypeFromCode(String code) throws GoallifeException{
		for (AccountStatusType item : AccountStatusType.values()) {
			if (item.code.equals(code)) {
				return item;
			}
		}
		
		throw new GoallifeException("This enum type is not supprted");
	}
}
